<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>猫眼后台系统</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
</head>

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">猫眼后台系统</div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;" id="userName"></a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" id="out">退了</a>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item">
                        <a target="main" href="./User/User.html">用户管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="main" href="./movie/movieSelect.html">电影管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="main" href="./Cinema/Cinema.html">院线管理</a>
                    </li>
                    <li class="layui-nav-item">
                        <a target="main" href="./Article/Article.html">文章管理</a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="layui-body" style="overflow: hidden">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;width: 100%;height: 100%;" id="divContent">
                <iframe src="" name="main" id="main" frameborder="0" width="100%" height="100%"></iframe>
            </div>
        </div>
    </div>
    <script src="./layui/layui.js"></script>
    <script src="./js/jquery-1.12.4.min.js"></script>
    <script src="./js/js.cookie.js"></script>
    <script>
        //JavaScript代码区域
        layui.use(['element', "layer"], function () {
            const layer = layui.layer;
            if (localStorage.getItem("name")) {
                $("#userName").text(localStorage.getItem("name"));
            } else {
                layer.msg('请登录!', {
                    icon: 2,
                    time: 1000,
                    end: function () {
                        location.href = './login.html';
                    }
                });
            }
            $("#out").click(function () {
                localStorage.removeItem("name");
                Cookies.remove("userId");
                location.href = './login.html';
            })
        })
    </script>
</body>

</html>